﻿using System;
using System.Data;

namespace JTLeigh.Commerce.Spencer.Core.Data.Services
{

	/// <summary>
	/// Factory used to create connections to databases.
	/// </summary>
	public interface IDatabaseConnectionFactory
	{

		#region Methods

		/// <summary>
		/// Creates a connection to the database with the specified database key.
		/// </summary>
		/// <param name="tenantId">The tenant identifier <see cref="Guid"/> of the tenant who the
		/// database connection is being created for.</param>
		/// <param name="databaseKey">The database key <see cref="String"/> used to identify the 
		/// database to connect to.</param>
		/// <returns>An <see cref="IDbConnection"/> connection to the specified database.</returns>
		IDbConnection CreateDatabaseConnection(Guid tenantId, string databaseKey);

		#endregion // Methods

	}

}
